﻿
using System;
using Npgsql;
using System.Data;
using System.Data.SqlTypes;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic ;
using System.Web.Mvc ;



namespace Forums.Models
{
	
	public class User
	{
		private int userId;
		private string firstName;
		private string lastName;
		private string userName;
		private string userPwd;
		private string email;
		private string city;
		private string country;
		private string timezoneCode;
		
		
		
		
		public int UserId {
			get { return userId; }
			set { userId = value; }
		}
		
		[Required]
		[StringLength(8,MinimumLength =3)]
		[Display(Name = "First Name")]
		public string FirstName {
			get { return firstName; }
			set { firstName = value; }
		}

		[Required]
		[StringLength (9,MinimumLength=3)]
		public string LastName {
			get { return lastName; }
			set { lastName = value; }
		}
		
		
		[Required]
		[StringLength(6, MinimumLength = 3)]
		[Display(Name = "User Name")]
		[RegularExpression(@"(\S)+", ErrorMessage = "White space is not allowed")]
		
		public string UserName {
			get { return userName; }
			set { userName = value; }
		}
		
		[Required()]
		public string UserPwd {
			get { return userPwd; }
			set { userPwd = value; }
		}
		[Required()]
		
		public string Email {
			get { return email; }
			set { email = value; }
		}
		[Required()]
		public string City {
			get { return city; }
			set { city = value; }
		}
		[Required()]
		public string Country {get;set; }
		//        	get { return country; }
		//        	set { country = value; }
		//        }
		
		public IEnumerable <SelectListItem> Countries  {get;set; }
		
	
			//        public SelectList  TimeZones { get; set; }
//
			//        public void SetupViewModel()
			//   		 {
			//        	TimeZones = new SelectList(TimeZoneExtensions.BuildTimeZoneList(), "value", "text", "selected");
			//        	TimezoneCode = "UTC";
//
			//    	}
				[Required()]
		public string TimezoneCode {
			get {
				return timezoneCode;
			}
			set {
				timezoneCode = value;
			}
		}
		
		
	}
	}






